Skip to content

fix: Parse Retry-After header for 429s#474

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-429-retry-after
Open

fix: Parse Retry-After header for 429s#474
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-429-retry-after

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

Previously we actually had two levels of retries for "failed" requests to braintrust:

  • The background worker thread would retry if it failed to serialize OR if sending traces to /logs3 failed
  • The http transport layer would retry if we hit http error

This PR cleans that up to remove the background worker thread retries, and make the http transport layer (via the retry adapter) the only source of truth for retries. After that change, it adds support for retrying on 429s to the retry adapter, leveraging the Retry-After header to determine when to properly do backoffs.

dependent on https://github.com/braintrustdata/braintrust/pull/14886 deploying as that fixes how we send Retry-After

We remove retry logic from the background logger, and move it into the http adapter layer.
This means we only retry on meaningful errors, like network issues or 429s. If we hit 429s,
we now also correctly parse the Retry-After header to determine what the exponential backoff
should be.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants